<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    console.log(/哈/.test('哈哈'))
    console.log(/二哈/.test('哈二哈'))
    console.log(/二哈很二/.test('二哈'))

    //便界符 ^
    console.log(/^哈/.test('哈哈'))
    console.log(/^哈哈/.test('二哈哈'))
    console.log(/^哈哈哈哈/.test('哈哈哈娃哈哈'))

    //$ 结尾
    console.log(/哈$/.test('哈哈'))
    console.log(/二哈$/.test('二哈二哈'))
</script>
</body>
</html>